<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var 全局作用域
            var num = 1;
            var str = "zs";
            var list = ["zs", "ls"];
            var user = {
                name: "zs",
                age: 18
            };
            var chr = 'c';
            var s = "xijun"



        // 局部变量，只能在某些{}作用域使用
            if(true){
                let i = 4
            }
        //外面访问不到 i = 4

        // 常量不能被修改
            const i = 8


            var a = 1;

        // typeof: 类型检测
        // typeof i -> Number, i是Number类型
            console.log(typeof a)   //number
            console.log(a instanceof Number)   //true


            var num = new Number(10)
            console.log(num instanceof Number)  //object
            console.log(typeof num)    // false
    </script>
    
</body>
</html>